<template>
    <div>
        <el-row v-for="(items, index) in infoConfig" :key="index">
            <el-col v-for="item in items" :key="item.value" :span="12">
                <el-form-item :label="item.label">
                    <el-input
                        v-if="item.type == 'input' || item.type == 'textarea'"
                        v-model="dataForm[item.value]"
                        :size="size"
                        style="width:216px"
                        :type="item.type"
                    />
                    <el-select
                        v-if="item.type == 'select'"
                        v-model="dataForm[item.value]"
                        :size="size"
                        :filterable="true"
                    >
                        <el-option v-for="key in item.options" :key="key.label" :label="key.text" :value="key.id" />
                    </el-select>
                    <template v-if="item.type == 'checkbox'">
                        <el-checkbox v-model="dataForm[item.value]">
                            {{ item.label }}
                        </el-checkbox>
                    </template>
                    <template v-if="item.type == 'radio'">
                        <el-radio
                            v-for="_radio in item.radioLists"
                            :key="_radio.id"
                            v-model="dataForm[item.value]"
                            :label="_radio.id"
                        >
                            {{ _radio.text }}
                        </el-radio>
                    </template>
                </el-form-item>
            </el-col>
        </el-row>
    </div>
</template>
<script>
export default {
    props: {
        infoConfig: {
            type: Array,
            default: () => {
                return []
            }
        },
        dataForm: {
            type: Object,
            default: () => {
                return {}
            }
        },
        size: {
            type: String,
            default: 'small'
        }
    }
}
</script>
